/*
 * @Author: dlb
 * @Date: 2020-06-25 10:52:19
 * @LastEditTime: 2020-06-25 10:52:34
 * @LastEditors: dlb
 * @Description:
 * @FilePath: \react-training-camp\server\src\models\lesson.ts
 * @可以输入预定的版权声明、个性签名、空行等
 */
import mongoose, { Schema, Document } from 'mongoose'
export interface ILessonDocument extends Document {
  order: number //顺序
  title: string //标题
  video: string //视频
  poster: string //海报
  url: string //url地址
  price: string //价格
  category: string //分类
  _doc: ILessonDocument
}
const LessonSchema: Schema<ILessonDocument> = new Schema(
  {
    order: Number, //顺序
    title: String, //标题
    video: String, //视频
    poster: String, //海报
    url: String, //url地址
    price: String, //价格
    category: String //分类
  },
  { timestamps: true }
)

export const Lesson = mongoose.model<ILessonDocument>('Lesson', LessonSchema)
